using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerAimingSwordState : PlayerState
{
    public PlayerAimingSwordState(Player _player, PlayerStateMachine _stateMachine, string _animBoolName) : base(_player, _stateMachine, _animBoolName)
    {
    }

    public override void Enter()
    {
        base.Enter();
        player.skill.sword.DotsActive(true);

    }

    public override void Exit()
    {
        base.Exit();
    }

    public override void update()
    {
        base.update();
        player.SetZeroVelocity();
        if (Input.GetKeyUp(KeyCode.Mouse1))
        {
            stateMachine.ChangeState(player.idleState);

        }
        Vector2 mousePosition=Camera.main.ScreenToWorldPoint(Input.mousePosition);
        if(player.transform.position.x>mousePosition.x && player.facingDir==1) {
            player.Flip();
        }
        else if (player.transform.position.x < mousePosition.x && player.facingDir == -1)
        {
            player.Flip();
        }
    }
}
